.class Lrexsee/network/RexseeInstantAudio$3;
.super Lrexsee/network/SocketAbstractClass$SocketConnectedListener;
.source "RexseeInstantAudio.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lrexsee/network/RexseeInstantAudio;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lrexsee/network/RexseeInstantAudio;


# direct methods
.method constructor <init>(Lrexsee/network/RexseeInstantAudio;)V
    .locals 0

    .prologue
    .line 1
    iput-object p1, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    .line 52
    invoke-direct {p0}, Lrexsee/network/SocketAbstractClass$SocketConnectedListener;-><init>()V

    return-void
.end method

.method static synthetic access$0(Lrexsee/network/RexseeInstantAudio$3;)Lrexsee/network/RexseeInstantAudio;
    .locals 1

    .prologue
    .line 52
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    return-object v0
.end method


# virtual methods
.method public run(Ljava/lang/String;J)V
    .locals 11
    .param p1, "id"    # Ljava/lang/String;
    .param p2, "index"    # J

    .prologue
    .line 55
    const-wide/16 v0, -0x1

    cmp-long v0, p2, v0

    if-eqz v0, :cond_3

    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mServer:Lrexsee/network/SocketServer;
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$1(Lrexsee/network/RexseeInstantAudio;)Lrexsee/network/SocketServer;

    move-result-object v0

    invoke-virtual {v0, p2, p3}, Lrexsee/network/SocketServer;->getSocket(J)Ljava/net/Socket;

    move-result-object v0

    move-object v10, v0

    .line 56
    .local v10, "mSocket":Ljava/net/Socket;
    :goto_0
    const-wide/16 v0, -0x1

    cmp-long v0, p2, v0

    if-eqz v0, :cond_4

    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mServerAllowRecord:Z
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$3(Lrexsee/network/RexseeInstantAudio;)Z

    move-result v0

    move v9, v0

    .line 57
    .local v9, "mAllowRecord":Z
    :goto_1
    const-wide/16 v0, -0x1

    cmp-long v0, p2, v0

    if-eqz v0, :cond_5

    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mServerAllowPlayback:Z
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$5(Lrexsee/network/RexseeInstantAudio;)Z

    move-result v0

    move v8, v0

    .line 58
    .local v8, "mAllowPlayback":Z
    :goto_2
    if-eqz v10, :cond_0

    invoke-virtual {v10}, Ljava/net/Socket;->isConnected()Z

    move-result v0

    if-nez v0, :cond_6

    .line 59
    :cond_0
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$0(Lrexsee/network/RexseeInstantAudio;)Lrexsee/core/browser/Browser;

    move-result-object v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$0(Lrexsee/network/RexseeInstantAudio;)Lrexsee/core/browser/Browser;

    move-result-object v0

    iget-object v1, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    invoke-virtual {v1}, Lrexsee/network/RexseeInstantAudio;->getInterfaceName()Ljava/lang/String;

    move-result-object v1

    const-string v2, "Socket is not ready."

    invoke-virtual {v0, v1, v2}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    .line 130
    :cond_1
    :goto_3
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$0(Lrexsee/network/RexseeInstantAudio;)Lrexsee/core/browser/Browser;

    move-result-object v0

    if-eqz v0, :cond_2

    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$0(Lrexsee/network/RexseeInstantAudio;)Lrexsee/core/browser/Browser;

    move-result-object v0

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onSocketConnected"

    const/4 v2, 0x2

    new-array v2, v2, [Ljava/lang/String;

    const/4 v3, 0x0

    aput-object p1, v2, v3

    const/4 v3, 0x1

    invoke-static {p2, p3}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v4

    aput-object v4, v2, v3

    invoke-virtual {v0, v1, v2}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;[Ljava/lang/String;)V

    .line 131
    :cond_2
    return-void

    .line 55
    .end local v8    # "mAllowPlayback":Z
    .end local v9    # "mAllowRecord":Z
    .end local v10    # "mSocket":Ljava/net/Socket;
    :cond_3
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mClient:Lrexsee/network/SocketClient;
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$2(Lrexsee/network/RexseeInstantAudio;)Lrexsee/network/SocketClient;

    move-result-object v0

    invoke-virtual {v0}, Lrexsee/network/SocketClient;->getSocket()Ljava/net/Socket;

    move-result-object v0

    move-object v10, v0

    goto :goto_0

    .line 56
    .restart local v10    # "mSocket":Ljava/net/Socket;
    :cond_4
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mClientAllowRecord:Z
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$4(Lrexsee/network/RexseeInstantAudio;)Z

    move-result v0

    move v9, v0

    goto :goto_1

    .line 57
    .restart local v9    # "mAllowRecord":Z
    :cond_5
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mClientAllowPlayback:Z
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$6(Lrexsee/network/RexseeInstantAudio;)Z

    move-result v0

    move v8, v0

    goto :goto_2

    .line 61
    .restart local v8    # "mAllowPlayback":Z
    :cond_6
    if-eqz v9, :cond_8

    .line 62
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    new-instance v1, Lrexsee/network/RexseeInstantAudio$3$1;

    invoke-direct {v1, p0, p2, p3, v10}, Lrexsee/network/RexseeInstantAudio$3$1;-><init>(Lrexsee/network/RexseeInstantAudio$3;JLjava/net/Socket;)V

    invoke-static {v0, v1}, Lrexsee/network/RexseeInstantAudio;->access$13(Lrexsee/network/RexseeInstantAudio;Ljava/lang/Thread;)V

    .line 108
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mRecordThread:Ljava/lang/Thread;
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$14(Lrexsee/network/RexseeInstantAudio;)Ljava/lang/Thread;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    .line 113
    :goto_4
    if-eqz v8, :cond_9

    .line 115
    :try_start_0
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mAudioTrack:Landroid/media/AudioTrack;
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$15(Lrexsee/network/RexseeInstantAudio;)Landroid/media/AudioTrack;

    move-result-object v0

    if-eqz v0, :cond_7

    .line 116
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mAudioTrack:Landroid/media/AudioTrack;
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$15(Lrexsee/network/RexseeInstantAudio;)Landroid/media/AudioTrack;

    move-result-object v0

    invoke-virtual {v0}, Landroid/media/AudioTrack;->stop()V

    .line 117
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mAudioTrack:Landroid/media/AudioTrack;
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$15(Lrexsee/network/RexseeInstantAudio;)Landroid/media/AudioTrack;

    move-result-object v0

    invoke-virtual {v0}, Landroid/media/AudioTrack;->release()V

    .line 118
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lrexsee/network/RexseeInstantAudio;->access$16(Lrexsee/network/RexseeInstantAudio;Landroid/media/AudioTrack;)V

    .line 120
    :cond_7
    iget-object v7, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    new-instance v0, Landroid/media/AudioTrack;

    const/4 v1, 0x3

    const/16 v2, 0x5622

    const/4 v3, 0x2

    const/4 v4, 0x2

    iget-object v5, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mPalybackBufferSizeInByte:I
    invoke-static {v5}, Lrexsee/network/RexseeInstantAudio;->access$17(Lrexsee/network/RexseeInstantAudio;)I

    move-result v5

    const/4 v6, 0x1

    invoke-direct/range {v0 .. v6}, Landroid/media/AudioTrack;-><init>(IIIIII)V

    invoke-static {v7, v0}, Lrexsee/network/RexseeInstantAudio;->access$16(Lrexsee/network/RexseeInstantAudio;Landroid/media/AudioTrack;)V

    .line 121
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mAudioTrack:Landroid/media/AudioTrack;
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$15(Lrexsee/network/RexseeInstantAudio;)Landroid/media/AudioTrack;

    move-result-object v0

    const v1, 0x3f666666    # 0.9f

    const v2, 0x3f666666    # 0.9f

    invoke-virtual {v0, v1, v2}, Landroid/media/AudioTrack;->setStereoVolume(FF)I

    .line 122
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mAudioTrack:Landroid/media/AudioTrack;
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$15(Lrexsee/network/RexseeInstantAudio;)Landroid/media/AudioTrack;

    move-result-object v0

    invoke-virtual {v0}, Landroid/media/AudioTrack;->play()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto/16 :goto_3

    .line 123
    :catch_0
    move-exception v0

    move-object v7, v0

    .line 124
    .local v7, "e":Ljava/lang/Exception;
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$0(Lrexsee/network/RexseeInstantAudio;)Lrexsee/core/browser/Browser;

    move-result-object v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    # getter for: Lrexsee/network/RexseeInstantAudio;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v0}, Lrexsee/network/RexseeInstantAudio;->access$0(Lrexsee/network/RexseeInstantAudio;)Lrexsee/core/browser/Browser;

    move-result-object v0

    iget-object v1, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    invoke-virtual {v1}, Lrexsee/network/RexseeInstantAudio;->getInterfaceName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1, v7}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    goto/16 :goto_3

    .line 110
    .end local v7    # "e":Ljava/lang/Exception;
    :cond_8
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lrexsee/network/RexseeInstantAudio;->access$8(Lrexsee/network/RexseeInstantAudio;Landroid/media/AudioRecord;)V

    .line 111
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lrexsee/network/RexseeInstantAudio;->access$13(Lrexsee/network/RexseeInstantAudio;Ljava/lang/Thread;)V

    goto :goto_4

    .line 127
    :cond_9
    iget-object v0, p0, Lrexsee/network/RexseeInstantAudio$3;->this$0:Lrexsee/network/RexseeInstantAudio;

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lrexsee/network/RexseeInstantAudio;->access$16(Lrexsee/network/RexseeInstantAudio;Landroid/media/AudioTrack;)V

    goto/16 :goto_3
.end method
